//
//  ProductDetailViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/4/27.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "ProductDetailViewController.h"
#import "KWFormView.h"
#import "AFNetworking.h"
#import "DanXiangArrayModel.h"
#import "DiseaseArrayViewController.h"
#import "LeiContentDetailIntroduceViewController.h"
#import "MoreZiXunViewController.h"

@interface ProductDetailViewController ()<UIScrollViewDelegate, KWFormViewDataSource, KWFormViewDelegate>

@property (nonatomic, strong) UIScrollView *backGroundScrollV; // 背景

@property (nonatomic, strong) NSMutableArray *jiBingNameArray; // 存储疾病名字的数组


@property (nonatomic, assign) CGFloat jianCeNeiRongBottom; // 检测意义底部高度
@property (nonatomic, assign) CGFloat dongHuaHeight; // 动画的高度

@property (nonatomic, strong) NSString *productImageUrl; // 产品图片url
@property (nonatomic, strong) NSString *productTitle; // 产品名称
@property (nonatomic, strong) NSString *productShortIntroduce; // 产品简短介绍
@property (nonatomic, strong) NSMutableString *productDetailIntroduce; // 产品详情介绍
@property (nonatomic, assign) NSInteger leiDetailIntroduceQianJiGeDaXie; // 类详情介绍的前几个需要大写
@property (nonatomic, strong) NSString *jianCeYiYiTuPian; // 检测意义图片
@property (nonatomic, strong) NSString *gengDuoXinXiTuPian; // 更多信息图片

@property (nonatomic, strong) NSMutableArray *productCheckValueArray; // 产品检测意义
@property (nonatomic, strong) NSMutableString *productTargetPopulationString; // 类使用人群
@property (nonatomic, strong) NSMutableArray *targetPopulationImageArray; // 类适用人群图片数组
@property (nonatomic, strong) NSMutableArray *diseaseDanXiangArray; // 疾病单项数组
@property (nonatomic, strong) NSMutableArray *diseaseNameArray; // 疾病名字数组



@property (nonatomic, strong) NSTimer *myTimer; // 检查请求是否超时
@property (nonatomic, assign) NSInteger numberOfTime; // 存储请求时间

@end



@implementation ProductDetailViewController

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    self.tabBarController.tabBar.hidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];
    // 关闭动画
    [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
    // 关闭计时器
    [self.myTimer invalidate];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    // navi的修改
    [self changeNavigation];
    // 布局
    [self addMySubview];
    // 检查网络并建立数据源
    [self searchNetAndAddData];
}

#pragma mark - 检查网络并建立数据源
- (void)searchNetAndAddData
{
    if ([[[NetStatusHandle shareHandle] getNetStatus] isEqualToString:@"YES"]) {
        [self addData];
        // 建立计数器
        self.myTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(goTimeOnLei:) userInfo:nil repeats:YES];
        self.numberOfTime = 0;
        [[NSRunLoop currentRunLoop] addTimer:self.myTimer forMode:NSRunLoopCommonModes];
        // 开启加载动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] startAnimation];
    } else {
        NSLog(@"没有网络");
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kNoNetNoRefresh ToView:self];
    }
}

#pragma mark - 计时器方法
- (void)goTimeOnLei:(NSTimer *)timer
{
    self.numberOfTime++;
    NSLog(@"时间:%ld", self.numberOfTime);
    if (self.numberOfTime > 10) {
        NSLog(@"请求超时");
        self.numberOfTime = 0;
        [self.myTimer invalidate];
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kQingQiuChaoShiNoReFresh ToView:self];
    }

}



// 请求数据
- (void)addData
{
    NSString *urlString = [NSString stringWithFormat:@"http://120.26.129.84/api/disease/classification/detail/%@", self.leiIDString];
    AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
    [manager GET:urlString parameters:nil success:^(NSURLSessionDataTask *task, id responseObject) {
        if (!responseObject) {
            return;
        }
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        self.numberOfTime = 0;
        [self.myTimer invalidate];
     //   NSLog(@"数据=%@", responseObject);
   //     NSDictionary *productDic = [responseObject valueForKey:@"production"];
        // 进行产品名称、产品介绍、产品图片的赋值
        // 类名字
        self.productTitle = responseObject[@"name"];
        // 类简短介绍
        self.productShortIntroduce = responseObject[@"short_description"];
        // 类详细介绍
        NSArray *descriptionArray = [responseObject valueForKey:@"description"];
        self.productDetailIntroduce = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < descriptionArray.count; i++) {
            NSString *tempString = descriptionArray[i];
            NSString *resultString = @"";
            if (i == 0) {
                resultString = [NSString stringWithFormat:@"       %@", tempString];
                self.leiDetailIntroduceQianJiGeDaXie = tempString.length;
            } else if (i == 1) {
                resultString = [NSString stringWithFormat:@"%@\n", tempString];
            } else {
              resultString =  [NSString stringWithFormat:@"       %@\n", tempString];
            }
            
            [self.productDetailIntroduce appendString:resultString];
        }
        // 类左边图标
        self.productImageUrl = responseObject[@"advertis_img_url"];
        // 类检测意义
        NSArray *senseArray  = responseObject[@"sense"];
        self.productCheckValueArray = [NSMutableArray array];
        for (NSString *tempString in senseArray) {
            [self.productCheckValueArray addObject:tempString];
        }
        // 类检测意义图片
        self.jianCeYiYiTuPian = [responseObject valueForKey:@"sense_img_url"];
        // 更多信息图片
        self.gengDuoXinXiTuPian = [responseObject valueForKey:@"more_info_img_url"];
        
        // 类适用人群
       NSArray *target_populationArray = responseObject[@"target_population"];
        self.productTargetPopulationString = [NSMutableString stringWithFormat:@""];
        for (int i = 0; i < target_populationArray.count; i++) {
            NSString *tempString = target_populationArray[i];
            NSString *resultString = @"";
            if (i == (target_populationArray.count -1)) {
                resultString = [NSString stringWithFormat:@"%d、%@", i+1,tempString];
            } else {
                resultString = [NSString stringWithFormat:@"%d、%@\n", i+1,tempString];
            }
            [self.productTargetPopulationString appendString:resultString];
        }
        
        NSArray *target_population_img_urlArray = [responseObject valueForKey:@"target_population_img_url"];
        self.targetPopulationImageArray = [NSMutableArray array];
        for (NSString *tempString in target_population_img_urlArray) {
            [self.targetPopulationImageArray addObject:tempString];
        }
        
        
        // 进行疾病单项数组的赋值
        self.diseaseDanXiangArray = [NSMutableArray array];
        self.diseaseNameArray = [NSMutableArray array];
        NSArray *diseaseDict = responseObject[@"diseases"];
       
        for (NSDictionary *tempDic in diseaseDict) {
            DanXiangArrayModel *tempModel = [[DanXiangArrayModel alloc] init];
            [tempModel setValuesForKeysWithDictionary:tempDic];
            [self.diseaseDanXiangArray addObject:tempModel];
            [self.diseaseNameArray addObject:[tempDic valueForKey:@"name"]];
        }
     //   NSLog(@"数量:%ld", self.diseaseNameArray.count);
      //  NSLog(@"self.diseaseDanXiangArray = %@", self.diseaseDanXiangArray);
        
        // 再走一次布局方法
        [self addMySubview];
        [self changeNavigation];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        NSLog(@"数据请求失败");
        // 关闭动画
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] stopAnimation];
        // 添加提示框
        [[JiaZaiAnimationHandle shareJiaZaiAnimationHandle] addAlertTitle:@"通知" Content:kHuoQuDataShiBaiNoRefresh ToView:self];
        // 暂停计时器
        [self.myTimer invalidate];
        self.numberOfTime = 0;
    }];
}

// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];

    // 左边
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    UIBarButtonItem *leftFirstItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];

    UILabel *productPackageNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
    productPackageNameLabel.text = self.productTitle;
    productPackageNameLabel.textColor = [UIColor whiteColor];
    productPackageNameLabel.font = [UIFont fontWithName:@"Arial-BoldMT" size:k18Big];
    productPackageNameLabel.textAlignment = NSTextAlignmentLeft;
    UIBarButtonItem *leftSecondItem = [[UIBarButtonItem alloc] initWithCustomView:productPackageNameLabel];
    self.navigationItem.leftBarButtonItems = @[leftFirstItem, leftSecondItem];
   
    
    
    //右边
    UIImageView *fenxiangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    fenxiangImageV.image = [UIImage imageNamed:@"fenxiang"];
    UITapGestureRecognizer *fenxiangTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fenxiang:)];
    [fenxiangImageV addGestureRecognizer:fenxiangTapGes];
    UIBarButtonItem *rightFirstItem = [[UIBarButtonItem alloc] initWithCustomView:fenxiangImageV];
    
//    UIImageView *shoucangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
//    shoucangImageV.image = [UIImage imageNamed:@"weishoucang-chanpin"];
//    UITapGestureRecognizer *shoucangTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(shoucang:)];
//    [shoucangImageV addGestureRecognizer:shoucangTapGes];
//    UIBarButtonItem *rightSecondItem = [[UIBarButtonItem alloc] initWithCustomView:shoucangImageV];
    self.navigationItem.rightBarButtonItem = rightFirstItem;
    
    
}

#pragma mark - 返回
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 分享
- (void)fenxiang:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"分享");
}

#pragma mark - 收藏
- (void)shoucang:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"收藏");
}

#pragma mark - 布局
- (void)addMySubview
{
    self.backGroundScrollV = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    self.backGroundScrollV.backgroundColor = [UIColor whiteColor];
    self.backGroundScrollV.contentSize = CGSizeMake(kScreenWidth, 4 * kScreenHeight);
    self.backGroundScrollV.delegate = self;
    self.backGroundScrollV.bounces = NO;
    [self.view addSubview:_backGroundScrollV];
    
#warning  产品简介
    
    // 产品简介图片
    UIImageView *chanPinImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinImageV.image = [UIImage imageNamed:@"newchanpinjianjie"];
    [self.backGroundScrollV addSubview:chanPinImageV];
    
    // 产品简介标题
    UILabel *chanPinTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinImageV.right + 12 * kAdjustParamater, 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
  //  chanPinTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinTitleLabel.text = @"疾病概况";
    chanPinTitleLabel.textColor = kCyanColor;
    chanPinTitleLabel.textAlignment = NSTextAlignmentCenter;
    chanPinTitleLabel.font = [UIFont systemFontOfSize:k18Big];
    chanPinTitleLabel.layer.borderColor = [kCyanColor CGColor];
    chanPinTitleLabel.layer.borderWidth = 1 * kAdjustParamater;
    chanPinTitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:chanPinTitleLabel];
    
    // 详情
    UILabel *canPinDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(305 * kAdjustParamater, 25 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
    canPinDetailLabel.userInteractionEnabled = YES;
    canPinDetailLabel.text = @"详情";
  //  canPinDetailLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    canPinDetailLabel.textColor = kCyanColor;
    canPinDetailLabel.textAlignment = NSTextAlignmentCenter;
    canPinDetailLabel.font = [UIFont systemFontOfSize:k17Big];
    [self.backGroundScrollV addSubview:canPinDetailLabel];
    UITapGestureRecognizer *canpinDetailLabelTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(canPinDetailLabelGes:)];
    [canPinDetailLabel addGestureRecognizer:canpinDetailLabelTapGes];
    
    // 类简介图标下方的灰色条
    UILabel *grayLineOnLeiJianJieTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnLeiJianJieTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnLeiJianJieTuBiaoBottom];
    
    // 产品简介详情图片
    UIImageView *canPinDetailImageV = [[UIImageView alloc] initWithFrame:CGRectMake(canPinDetailLabel.right + 6 * kAdjustParamater, 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    canPinDetailImageV.userInteractionEnabled = YES;
    canPinDetailImageV.image = [UIImage imageNamed:@"chanpinxiangqing"];
    [self.backGroundScrollV addSubview:canPinDetailImageV];
    
    UITapGestureRecognizer *canPinDetailImageVTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(canPinDetalGes:)];
    [canPinDetailImageV addGestureRecognizer:canPinDetailImageVTapGes];
    
    // 类左边图片
    UIImageView *canPinImageV = [[UIImageView alloc] initWithFrame:CGRectMake(25 * kAdjustParamater, grayLineOnLeiJianJieTuBiaoBottom.bottom + 30 * kAdjustParamater, 140 * kAdjustParamater, 140 * kAdjustParamater)];
    canPinImageV.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:1];
    NSString *leiImageUrl = [self.productImageUrl stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    [canPinImageV sd_setImageWithURL:[NSURL URLWithString:leiImageUrl] placeholderImage:[UIImage imageNamed:@""]];
    [self.backGroundScrollV addSubview:canPinImageV];
    
    // 简介灰色背景框
    UIView *canPinGrayBackGroundView = [[UIView alloc] initWithFrame:CGRectMake(canPinImageV.right + 20 * kAdjustParamater, canPinImageV.top - 5 * kAdjustParamater, 177 * kAdjustParamater, 142 * kAdjustParamater)];
    canPinGrayBackGroundView.layer.cornerRadius = 7 * kAdjustParamater;
    canPinGrayBackGroundView.layer.masksToBounds = YES;
    canPinGrayBackGroundView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.2];
    [self.backGroundScrollV addSubview:canPinGrayBackGroundView];
    
    // 灰色背景框上面的白色背景框
    UIView *whiteBackGroundViewOnGrayView = [[UIView alloc] initWithFrame:CGRectMake(3 * kAdjustParamater, 3 * kAdjustParamater, 171 * kAdjustParamater, 136 * kAdjustParamater)];
    whiteBackGroundViewOnGrayView.backgroundColor = [UIColor whiteColor];
    whiteBackGroundViewOnGrayView.layer.cornerRadius = 7 * kAdjustParamater;
    whiteBackGroundViewOnGrayView.layer.masksToBounds = YES;
    [canPinGrayBackGroundView addSubview:whiteBackGroundViewOnGrayView];
    
    // 产品标题
    UILabel *chanPinTitle = [[UILabel alloc] initWithFrame:CGRectMake(5 * kAdjustParamater, 7 * kAdjustParamater, 151 * kAdjustParamater, 15 * kAdjustParamater)];
 //   chanPinTitle.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinTitle.text = self.productTitle;
    chanPinTitle.textAlignment = NSTextAlignmentCenter;
    chanPinTitle.font = [UIFont systemFontOfSize:k16Big];
    chanPinTitle.textColor = [UIColor redColor];
    [whiteBackGroundViewOnGrayView addSubview:chanPinTitle];
    
    // 产品介绍
    UILabel *chanPinIntroduce = [[UILabel alloc] initWithFrame:CGRectMake(6 * kAdjustParamater, chanPinTitle.bottom + 3 * kAdjustParamater, 162 * kAdjustParamater, 110 * kAdjustParamater)];
   //       chanPinIntroduce.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
  //  chanPinIntroduce.text = @"     张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文张国文111";
    if (self.productShortIntroduce != nil) {
        chanPinIntroduce.text = [NSString stringWithFormat:@"     %@", self.productShortIntroduce];
        chanPinIntroduce.numberOfLines = 0;
        chanPinIntroduce.textColor = [UIColor blackColor];
        chanPinIntroduce.font = [UIFont systemFontOfSize:k14Big];
//        // 保存最大尺寸
//        CGRect originFrame = chanPinIntroduce.frame;
        
        // 设置行间距
        [chanPinIntroduce setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:chanPinIntroduce.text lineHeight:4]];
        chanPinIntroduce.lineBreakMode = NSLineBreakByTruncatingTail;
        [chanPinIntroduce sizeToFit];
        

        whiteBackGroundViewOnGrayView.height = chanPinIntroduce.height + 28 * kAdjustParamater;
        canPinGrayBackGroundView.height = chanPinIntroduce.height + 34 * kAdjustParamater;
    }
    [whiteBackGroundViewOnGrayView addSubview:chanPinIntroduce];
    
  // 判断图片大还是灰色框
    CGFloat shouldBottom = 0.0;
    if (canPinImageV.bottom > canPinGrayBackGroundView.bottom) {
        shouldBottom = canPinImageV.bottom + 50 * kAdjustParamater;
    } else {
        shouldBottom = canPinGrayBackGroundView.bottom + 35 * kAdjustParamater;
    }
    
    
    // 产品简介下方的灰色条
    UILabel *grayLineOnCanPinJianJieBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, shouldBottom, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnCanPinJianJieBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnCanPinJianJieBottom];
    
    
#warning  产品检测内容
    
    // 产品检测图片
    UIImageView *chanPinJianCeImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnCanPinJianJieBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinJianCeImageV.image = [UIImage imageNamed:@"newchanpinneirong"];
    [self.backGroundScrollV addSubview:chanPinJianCeImageV];
    
    // 产品检测标题
    UILabel *chanPinJianCeTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinJianCeImageV.right + 12 * kAdjustParamater, grayLineOnCanPinJianJieBottom.bottom + 20 * kAdjustParamater, 140 * kAdjustParamater, 25 * kAdjustParamater)];
  //  chanPinJianCeTitleLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    chanPinJianCeTitleLabel.text = @"大类检测内容";
    chanPinJianCeTitleLabel.textColor = kCyanColor;
    chanPinJianCeTitleLabel.textAlignment = NSTextAlignmentCenter;
    chanPinJianCeTitleLabel.font = [UIFont systemFontOfSize:k18Big];
    chanPinJianCeTitleLabel.layer.borderColor = [kCyanColor CGColor];
    chanPinJianCeTitleLabel.layer.borderWidth = 1 * kAdjustParamater;
    chanPinJianCeTitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:chanPinJianCeTitleLabel];
    
    // 产品检测详情
    UILabel *canPinJianCeDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(305 * kAdjustParamater, grayLineOnCanPinJianJieBottom.bottom + 25 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
   // canPinJianCeDetailLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    canPinJianCeDetailLabel.userInteractionEnabled = YES;
    canPinJianCeDetailLabel.text = @"详情";
    canPinJianCeDetailLabel.textColor = kCyanColor;
    canPinJianCeDetailLabel.textAlignment = NSTextAlignmentCenter;
    canPinJianCeDetailLabel.font = [UIFont systemFontOfSize:k17Big];
    [self.backGroundScrollV addSubview:canPinJianCeDetailLabel];
    UITapGestureRecognizer *canPinJianCeDetailTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(canPinJianCeDetalGes:)];
    [canPinJianCeDetailLabel addGestureRecognizer:canPinJianCeDetailTapGes];
    
    // 产品检测详情图片
    UIImageView *canPinJianCeDetaiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(canPinJianCeDetailLabel.right + 6 * kAdjustParamater, grayLineOnCanPinJianJieBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    canPinJianCeDetaiImageV.userInteractionEnabled  = YES;
    canPinJianCeDetaiImageV.image = [UIImage imageNamed:@"chanpinxiangqing"];
    [self.backGroundScrollV addSubview:canPinJianCeDetaiImageV];
    UITapGestureRecognizer *canPinJianCeDetailImageTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(canPinJianCeDetailImageTap:)];
    [canPinJianCeDetaiImageV addGestureRecognizer:canPinJianCeDetailImageTapGes];
    
    // 类内容检测图标下方的灰色条
    UILabel *grayLineOnLeiJianCeNeiRongBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinJianCeImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnLeiJianCeNeiRongBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnLeiJianCeNeiRongBottom];
    
    // 构建模拟疾病名字的数组
 //   self.jiBingNameArray = [NSMutableArray arrayWithObjects:@"冠心病", @"糖尿病", @"心机梗塞", @"高血压", @"静脉血栓", @"高脂血脂", @"脑卒中", @"心房颤动", nil];
    self.jiBingNameArray = [NSMutableArray arrayWithArray:self.diseaseNameArray];
    // 产品检测内容表格倩色背景
    UIView *canPinJianCeBiaoGeBackGroundView = [[UIView alloc] init];
    if (self.jiBingNameArray.count % 3 > 0) {
        canPinJianCeBiaoGeBackGroundView.frame = CGRectMake(15 * kAdjustParamater, grayLineOnLeiJianCeNeiRongBottom.bottom + 22 * kAdjustParamater, 345 * kAdjustParamater, (self.jiBingNameArray.count / 3 + 1) * 30 * kAdjustParamater + 8 * kAdjustParamater);
    } else if (self.jiBingNameArray.count % 3 == 0) {
        canPinJianCeBiaoGeBackGroundView.frame = CGRectMake(15 * kAdjustParamater, grayLineOnLeiJianCeNeiRongBottom.bottom + 22 * kAdjustParamater, 345 * kAdjustParamater, (self.jiBingNameArray.count / 3) * 30 * kAdjustParamater + 8 * kAdjustParamater);
    }
    canPinJianCeBiaoGeBackGroundView.backgroundColor = kCyanColor;
    canPinJianCeBiaoGeBackGroundView.userInteractionEnabled = YES;
    [self.backGroundScrollV addSubview:canPinJianCeBiaoGeBackGroundView];
    
    // 表格
    
    KWFormView *canPinJianCeBiaoGeView = [[KWFormView alloc] initWithFrame:CGRectMake(4 * kAdjustParamater, 4 * kAdjustParamater, 337 * kAdjustParamater, (self.jiBingNameArray.count % 3 + 1) * 30 * kAdjustParamater)];
    canPinJianCeBiaoGeView.dataSource = self;
    canPinJianCeBiaoGeView.delegate = self;
    [canPinJianCeBiaoGeBackGroundView addSubview:canPinJianCeBiaoGeView];
    
    // 产品检测内容公司介绍
    UILabel *canPinJianCeGongSiIntroduceLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, canPinJianCeBiaoGeBackGroundView.bottom + 15 * kAdjustParamater, 345 * kAdjustParamater, 110 * kAdjustParamater)];
   // canPinJianCeGongSiIntroduceLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    canPinJianCeGongSiIntroduceLabel.text = @"        壹基因利用先进的捕获和测序技术，对采样者唾液DNA中的心脑血管疾病易感基因位点进行检测，并根据基因检测的结果为用户提供相应疾病的风险评估指数和健康建议报告.";
    canPinJianCeGongSiIntroduceLabel.textColor = [UIColor blackColor];
    canPinJianCeGongSiIntroduceLabel.font = [UIFont systemFontOfSize:k16Big];
    canPinJianCeGongSiIntroduceLabel.numberOfLines = 0;
    // 设置行间距
    [canPinJianCeGongSiIntroduceLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:canPinJianCeGongSiIntroduceLabel.text lineHeight:8]];
    [self.backGroundScrollV addSubview:canPinJianCeGongSiIntroduceLabel];
    
    // 产品检测内容下方灰色条
    UILabel *grayLineOnCanPinJianCeNeiRongBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, canPinJianCeGongSiIntroduceLabel.bottom + 55 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnCanPinJianCeNeiRongBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnCanPinJianCeNeiRongBottom];
    // 存储检测内容的高度
    self.jianCeNeiRongBottom = grayLineOnCanPinJianCeNeiRongBottom.bottom;
    
    
    
    
#warning 检测意义
    
    // 检测意义的小图片
    UIImageView *jianCeYiYiSmallImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnCanPinJianCeNeiRongBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    jianCeYiYiSmallImageV.image = [UIImage imageNamed:@"newjianceyiyi"];
    [self.backGroundScrollV addSubview:jianCeYiYiSmallImageV];
    
    // 检测意义标题
    UILabel *jianCeYiYITitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(jianCeYiYiSmallImageV.right + 12 * kAdjustParamater, grayLineOnCanPinJianCeNeiRongBottom.bottom + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    jianCeYiYITitleLabel.text = @"检测意义";
    jianCeYiYITitleLabel.textColor = kCyanColor;
    jianCeYiYITitleLabel.textAlignment = NSTextAlignmentCenter;
    jianCeYiYITitleLabel.font = [UIFont systemFontOfSize:k18Big];
    jianCeYiYITitleLabel.layer.borderColor = [kCyanColor CGColor];
    jianCeYiYITitleLabel.layer.borderWidth = 1 * kAdjustParamater;
    jianCeYiYITitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:jianCeYiYITitleLabel];
    
    // 检测意义图标下方的灰色条
    UILabel *grayLineOnJianCeYiYiTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jianCeYiYiSmallImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnJianCeYiYiTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnJianCeYiYiTuBiaoBottom];
    
    // 检测意义的图片
    UIImageView *jianCeYiYiImageV = [[UIImageView alloc] initWithFrame:CGRectMake((375 - 350) / 2  * kAdjustParamater, grayLineOnJianCeYiYiTuBiaoBottom.bottom + 20 * kAdjustParamater, 350 * kAdjustParamater, 235 * kAdjustParamater)];
    jianCeYiYiImageV.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    NSString *jianCeYiYiUrl = [self.jianCeYiYiTuPian stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
    [jianCeYiYiImageV sd_setImageWithURL:[NSURL URLWithString:jianCeYiYiUrl] placeholderImage:[UIImage imageNamed:@""]];
    [self.backGroundScrollV addSubview:jianCeYiYiImageV];
    
  //  NSLog(@"检测意义数组:%@", self.productCheckValueArray);
    // 进行检测意义内容的动态布局
    CGFloat jianCeYiYiNextHeight = 0.0; // 检测意义下一条的高度
    for (int i = 0; i < self.productCheckValueArray.count; i++) {
        // 左边的小方块
        UILabel *xiaoFangKuaiLabel = [[UILabel alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, jianCeYiYiImageV.bottom + 20 * kAdjustParamater + jianCeYiYiNextHeight, 20 * kAdjustParamater, 20 * kAdjustParamater)];
        xiaoFangKuaiLabel.backgroundColor = [UIColor colorWithRed:98 / 255.0 green:178 / 255.0 blue:186 / 255.0 alpha:1];
        xiaoFangKuaiLabel.layer.cornerRadius = 3 * kAdjustParamater;
        xiaoFangKuaiLabel.layer.masksToBounds = YES;
        [self.backGroundScrollV addSubview:xiaoFangKuaiLabel];
        // 右边的检测内容
        UILabel *contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(xiaoFangKuaiLabel.right + 10 * kAdjustParamater, xiaoFangKuaiLabel.top + 1 * kAdjustParamater, 300 * kAdjustParamater, 20 * kAdjustParamater)];
      //  contentLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
        contentLabel.text = self.productCheckValueArray[i];
        contentLabel.textColor = [UIColor blackColor];
        contentLabel.font = [UIFont systemFontOfSize:k17Big];
        contentLabel.numberOfLines = 0;
        // 进行行间距的调整
        [contentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:contentLabel.text lineHeight:5]];
        [contentLabel sizeToFit];
        [self.backGroundScrollV addSubview:contentLabel];
        // 内容下方的灰色条
        UILabel *grayLineOnContentBottom = [[UILabel alloc] init];
        grayLineOnContentBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
        grayLineOnContentBottom.tag = 200 + i;
                // 判断小方块的高度和内容高度的大小
        if (xiaoFangKuaiLabel.height >=(contentLabel.height - 1 * kAdjustParamater)) {
            grayLineOnContentBottom.frame = CGRectMake(0, xiaoFangKuaiLabel.bottom + 20 * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater);
            // 保存高度
            jianCeYiYiNextHeight = jianCeYiYiNextHeight + 20 * kAdjustParamater + 21 * kAdjustParamater  + 20 * kAdjustParamater;
        } else {
            grayLineOnContentBottom.frame = CGRectMake(0, contentLabel.bottom + 20 * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater);
            // 保存高度
            jianCeYiYiNextHeight = jianCeYiYiNextHeight + 20 * kAdjustParamater + contentLabel.height  + 20 * kAdjustParamater + 1 * kAdjustParamater + 1 * kAdjustParamater;
        }
        [self.backGroundScrollV addSubview:grayLineOnContentBottom];
        
        NSLog(@"jianCeYiYiNextHeight = %f", jianCeYiYiNextHeight);
    }
    
//    // 检测意义详情
//    UILabel *jianCeYiYiDetailLabel = [[UILabel alloc] initWithFrame:CGRectMake(305 * kAdjustParamater, grayLineOnCanPinJianCeNeiRongBottom.bottom + 35 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
//    jianCeYiYiDetailLabel.userInteractionEnabled = YES;
//    jianCeYiYiDetailLabel.text = @"详情";
//    jianCeYiYiDetailLabel.textColor = kCyanColor;
//    jianCeYiYiDetailLabel.textAlignment = NSTextAlignmentCenter;
//    jianCeYiYiDetailLabel.font = [UIFont systemFontOfSize:k17Big];
//    [self.backGroundScrollV addSubview:jianCeYiYiDetailLabel];
//    UITapGestureRecognizer *jianCeYiYiDetalLabelTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jianCeYiYiDetalLabelGes:)];
//    [jianCeYiYiDetailLabel addGestureRecognizer:jianCeYiYiDetalLabelTapGes];
//    
//    // 检测意义详情图片
//    UIImageView *jianCeYiYiDetailImageV = [[UIImageView alloc] initWithFrame:CGRectMake(jianCeYiYiDetailLabel.right + 6 * kAdjustParamater, grayLineOnCanPinJianCeNeiRongBottom.bottom + 30 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
//    jianCeYiYiDetailImageV.image = [UIImage imageNamed:@"chanpinxiangqing"];
//    jianCeYiYiDetailImageV.userInteractionEnabled = YES;
//    [self.backGroundScrollV addSubview:jianCeYiYiDetailImageV];
//    UITapGestureRecognizer *jianCeYiYiDetailImageVTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jianCeYiYiDetailImageVGes:)];
//    [jianCeYiYiDetailImageV addGestureRecognizer:jianCeYiYiDetailImageVTapGes];
//    
//    // 检测意义详情大图片
//    UIImageView *jianCeYiYiBigImageV = [[UIImageView alloc] initWithFrame:CGRectMake(50 * kAdjustParamater, jianCeYiYITitleLabel.bottom + 15 * kAdjustParamater, 200 * kAdjustParamater, 190 * kAdjustParamater)];
//    jianCeYiYiBigImageV.image = [UIImage imageNamed:@"chanpinfenxi-chanpin"];
//    [self.backGroundScrollV addSubview:jianCeYiYiBigImageV];
//    
//    // 靶向用药
//    UILabel *baXiangYongYaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(jianCeYiYiBigImageV.left + 135 * kAdjustParamater, jianCeYiYiBigImageV.top + 37 * kAdjustParamater, 100 * kAdjustParamater, 13 * kAdjustParamater)];
// //   baXiangYongYaoLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    baXiangYongYaoLabel.text = @"靶向用药";
//    baXiangYongYaoLabel.textColor = [UIColor redColor];
//    baXiangYongYaoLabel.textAlignment = NSTextAlignmentLeft;
//    baXiangYongYaoLabel.font = [UIFont systemFontOfSize:k15Big];
//    [self.backGroundScrollV addSubview:baXiangYongYaoLabel];
//    
//    
//    // 慢病管理
//    UILabel *manBingGuanLiLabel = [[UILabel alloc] initWithFrame:CGRectMake(jianCeYiYiBigImageV.left + 150 * kAdjustParamater, jianCeYiYiBigImageV.top + 67 * kAdjustParamater, 100 * kAdjustParamater, 13 * kAdjustParamater)];
//   // manBingGuanLiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    manBingGuanLiLabel.text = @"慢病管理";
//    manBingGuanLiLabel.textColor = [UIColor colorWithRed:231 / 255.0 green:217 / 255.0 blue:37 / 255.0 alpha:1];
//    manBingGuanLiLabel.textAlignment = NSTextAlignmentLeft;
//    manBingGuanLiLabel.font = [UIFont systemFontOfSize:k15Big];
//    [self.backGroundScrollV addSubview:manBingGuanLiLabel];
//    
//    // 精准医疗
//    UILabel *jingZhunYiLiaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(jianCeYiYiBigImageV.left + 166 * kAdjustParamater, jianCeYiYiBigImageV.top + 99 * kAdjustParamater, 100 * kAdjustParamater, 13 * kAdjustParamater)];
//   // jingZhunYiLiaoLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    jingZhunYiLiaoLabel.text = @"精准医疗";
//    jingZhunYiLiaoLabel.textColor = [UIColor colorWithRed:126 / 255.0 green:186 / 255.0 blue:25 / 255.0 alpha:1];
//    jingZhunYiLiaoLabel.font = [UIFont systemFontOfSize:k15Big];
//    [self.backGroundScrollV addSubview:jingZhunYiLiaoLabel];
//    
//    // 健康管理
//    UILabel *jianKangGuanLiLabel = [[UILabel alloc] initWithFrame:CGRectMake(jianCeYiYiBigImageV.left + 181 * kAdjustParamater, jianCeYiYiBigImageV.top + 128 * kAdjustParamater, 100 * kAdjustParamater, 13 * kAdjustParamater)];
//  //  jianKangGuanLiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    jianKangGuanLiLabel.text = @"健康管理";
//    jianKangGuanLiLabel.textColor = [UIColor colorWithRed:46 / 255.0 green:149 / 255.0 blue:205 / 255.0 alpha:1];
//    jianKangGuanLiLabel.textAlignment = NSTextAlignmentLeft;
//    jianKangGuanLiLabel.font = [UIFont systemFontOfSize:k15Big];
//    [self.backGroundScrollV addSubview:jianKangGuanLiLabel];
//    
//    
//    // 准对性防御
//    UILabel *zhunDuiXingFangYuLabel = [[UILabel alloc] initWithFrame:CGRectMake(jianCeYiYiBigImageV.left + 200 * kAdjustParamater, jianCeYiYiBigImageV.top + 161 * kAdjustParamater, 100 * kAdjustParamater, 13 * kAdjustParamater)];
//   // zhunDuiXingFangYuLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    zhunDuiXingFangYuLabel.text = @"准对性防御";
//    zhunDuiXingFangYuLabel.textColor = [UIColor colorWithRed:26 / 255.0 green:38 / 255.0 blue:129 / 255.0 alpha:1];
//    zhunDuiXingFangYuLabel.textAlignment = NSTextAlignmentLeft;
//    zhunDuiXingFangYuLabel.font = [UIFont systemFontOfSize:k15Big];
//    [self.backGroundScrollV addSubview:zhunDuiXingFangYuLabel];
    
    
    
    // 检测意义需要的bottom
    CGFloat jianCeYiYiShouldBottom = 0.0;
    if (self.productCheckValueArray.count > 0) {
        // 获取检测内容最后一条下方的灰色条
        UILabel *jianCiYiYiLastGrayLine = (UILabel *)[self.view viewWithTag:199 + self.productCheckValueArray.count];
        jianCeYiYiShouldBottom = jianCiYiYiLastGrayLine.bottom;
    } else {
        jianCeYiYiShouldBottom = jianCeYiYiImageV.bottom + 20 * kAdjustParamater;
    }
    // 检测意义底部的灰色条
    UILabel *grayLineOnJianCeYiYiBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, jianCeYiYiShouldBottom , kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnJianCeYiYiBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnJianCeYiYiBottom];
    // 存储动画的高度
    self.dongHuaHeight = grayLineOnJianCeYiYiBottom.top - grayLineOnCanPinJianCeNeiRongBottom.bottom;
    NSLog(@"高度 = %f", self.dongHuaHeight);
#warning 适用人群

    // 适用人群小图片
    UIImageView *shiYongRenQunImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnJianCeYiYiBottom.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    shiYongRenQunImageV.image = [UIImage imageNamed:@"newshiyongrenqun"];
    [self.backGroundScrollV addSubview:shiYongRenQunImageV];
    
    // 适用人群标题
    UILabel *shiYongRenQunTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(shiYongRenQunImageV.right + 12 * kAdjustParamater, grayLineOnJianCeYiYiBottom.bottom + 20 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    shiYongRenQunTitleLabel.text = @"适用人群";
    shiYongRenQunTitleLabel.textColor = kCyanColor;
    shiYongRenQunTitleLabel.textAlignment = NSTextAlignmentCenter;
    shiYongRenQunTitleLabel.font = [UIFont systemFontOfSize:k18Big];
    shiYongRenQunTitleLabel.layer.borderColor = [kCyanColor CGColor];
    shiYongRenQunTitleLabel.layer.borderWidth = 1 * kAdjustParamater;
    shiYongRenQunTitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:shiYongRenQunTitleLabel];
    
    UILabel *grayLineOnLeiShiYongRenQunTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, shiYongRenQunImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1.5 * kAdjustParamater)];
    grayLineOnLeiShiYongRenQunTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.08];
    [self.backGroundScrollV addSubview:grayLineOnLeiShiYongRenQunTuBiaoBottom];
    
    // 适用人群图片
    
    UIImageView *shiYongRenQunImageVOne = [[UIImageView alloc] initWithFrame:CGRectMake(30 * kAdjustParamater, grayLineOnLeiShiYongRenQunTuBiaoBottom.bottom + 25 * kAdjustParamater, 145 * kAdjustParamater, 127 * kAdjustParamater)];
    shiYongRenQunImageVOne.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    shiYongRenQunImageVOne.image = [UIImage imageNamed:@""];
    [self.backGroundScrollV addSubview:shiYongRenQunImageVOne];
    
    UIImageView *shiYongRenQunImageVTwo = [[UIImageView alloc] initWithFrame:CGRectMake(shiYongRenQunImageVOne.right + 25 * kAdjustParamater, grayLineOnLeiShiYongRenQunTuBiaoBottom.bottom + 25 * kAdjustParamater, 145 * kAdjustParamater, 127 * kAdjustParamater)];
    shiYongRenQunImageVTwo.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    shiYongRenQunImageVTwo.image = [UIImage imageNamed:@""];
    [self.backGroundScrollV addSubview:shiYongRenQunImageVTwo];
    
    if (self.targetPopulationImageArray.count == 0) {
        shiYongRenQunImageVOne.hidden = YES;
        shiYongRenQunImageVTwo.hidden = YES;
    } else if (self.targetPopulationImageArray.count == 1) {
        [shiYongRenQunImageVOne sd_setImageWithURL:[NSURL URLWithString:self.targetPopulationImageArray[0]] placeholderImage:[UIImage imageNamed:@""]];
        shiYongRenQunImageVTwo.hidden = YES;
    } else if (self.targetPopulationImageArray.count == 2) {
        [shiYongRenQunImageVOne sd_setImageWithURL:[NSURL URLWithString:self.targetPopulationImageArray[0]] placeholderImage:[UIImage imageNamed:@""]];
        [shiYongRenQunImageVTwo sd_setImageWithURL:[NSURL URLWithString:self.targetPopulationImageArray[1]] placeholderImage:[UIImage imageNamed:@""]];
    }
    
    // 适用人群
    UILabel *shiYongRenQunLabel = [[UILabel alloc] initWithFrame: CGRectMake(25 * kAdjustParamater, shiYongRenQunImageVOne.bottom + 33 * kAdjustParamater, 335 * kAdjustParamater, 20 * kAdjustParamater)];
   // shiYongRenQunLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
  //  shiYongRenQunLabel.text = @"1、久坐办公室,缺乏运动,经常熬夜的亚健康人群;\n\n2、具有高血压家族史的人群;\n\n3、患有“三高“等心肌梗死易感致病因素人群;\n\n4、具有较强健康管意识的人群;";
    if (self.productTargetPopulationString.length == 0) {
        shiYongRenQunLabel.text = @"";
    } else {
        shiYongRenQunLabel.text = self.productTargetPopulationString;
    }
    
    shiYongRenQunLabel.textColor = [UIColor blackColor];
    shiYongRenQunLabel.numberOfLines = 0;
    shiYongRenQunLabel.font = [UIFont systemFontOfSize:k17Big];
    // 改变行间距
    [shiYongRenQunLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:shiYongRenQunLabel.text lineHeight:10]];
    [shiYongRenQunLabel sizeToFit];
    
    [self.backGroundScrollV addSubview:shiYongRenQunLabel];
    
    
    // 使用人群底部灰色条
    UILabel *grayLineOnShiYongRenQunLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, shiYongRenQunLabel.bottom + 30 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
    grayLineOnShiYongRenQunLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:grayLineOnShiYongRenQunLabel];
    
    
//#warning 产品特色
//    // 产品特色图标
//    UIImageView *chanPinTeSeImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnShiYongRenQunLabel.bottom + 30 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
//    chanPinTeSeImageV.image = [UIImage imageNamed:@"chanpintese-chanpin"];
//    [self.backGroundScrollV addSubview:chanPinTeSeImageV];
//    
//    // 产品特色标题
//    UILabel *chanPinTeSeTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinTeSeImageV.right + 12 * kAdjustParamater, grayLineOnShiYongRenQunLabel.bottom + 30 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
//    chanPinTeSeTitleLabel.text = @"产品特色";
//    chanPinTeSeTitleLabel.textColor = kCyanColor;
//    chanPinTeSeTitleLabel.textAlignment = NSTextAlignmentCenter;
//    chanPinTeSeTitleLabel.font = [UIFont systemFontOfSize:k18Big];
//    chanPinTeSeTitleLabel.layer.borderColor = [kCyanColor CGColor];
//    chanPinTeSeTitleLabel.layer.borderWidth = 1 * kAdjustParamater;
//    chanPinTeSeTitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
//    [self.backGroundScrollV addSubview:chanPinTeSeTitleLabel];
//    
//    // 产品特色大图
//    UIImageView *chanPinTeSeBigImageV = [[UIImageView alloc] initWithFrame:CGRectMake(47 * kAdjustParamater, chanPinTeSeTitleLabel.bottom + 60 * kAdjustParamater, 280 * kAdjustParamater, 237 * kAdjustParamater)];
//    chanPinTeSeBigImageV.image = [UIImage imageNamed:@"chanpintesedatu-chanpin"];
//   // chanPinTeSeBigImageV.backgroundColor = [UIColor redColor];
//    [self.backGroundScrollV addSubview:chanPinTeSeBigImageV];
//    
//    // 产品特色简介的背景白色图
//    UIView *whiteBackGroundViewOnChanPinTese = [[UIView alloc] initWithFrame:CGRectMake(17 * kAdjustParamater, chanPinTeSeBigImageV.bottom + 45 * kAdjustParamater, 334 * kAdjustParamater, 274 * kAdjustParamater)];
//    whiteBackGroundViewOnChanPinTese.backgroundColor = [UIColor whiteColor];
//    whiteBackGroundViewOnChanPinTese.layer.borderColor = [[[UIColor blackColor] colorWithAlphaComponent:0.2] CGColor];
//    whiteBackGroundViewOnChanPinTese.layer.borderWidth = 3 * kAdjustParamater;
//    whiteBackGroundViewOnChanPinTese.layer.cornerRadius = 5 * kAdjustParamater;
//    [self.backGroundScrollV addSubview:whiteBackGroundViewOnChanPinTese];
//    
//    // 产品特色简介
//    UILabel *chanPinTeSeJieShaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, 10 * kAdjustParamater, whiteBackGroundViewOnChanPinTese.width - 15 * kAdjustParamater, whiteBackGroundViewOnChanPinTese.height - 20 * kAdjustParamater)];
//  //  chanPinTeSeJieShaoLabel.backgroundColor = [[UIColor redColor] colorWithAlphaComponent:0.1];
//   // chanPinTeSeJieShaoLabel.text = @"性价比高：产品拥有让人羡慕的性价比\n\n检测专业：公司团队拥有专业的基因测序和\n\n\t\t信息分析团队\n\n位点精确：检测位点拥有最为苛刻的挑选标\n\n\t\t准\n\n矫正系统：风险评估拥有自主研发的其他致\n\n\t\t病因素纠正系统\n\n社交属性：用户检测后拥有一套属于你的个\n\n\t\t性标签和基因关系";
//    chanPinTeSeJieShaoLabel.text = @"性价比高：产品拥有让人羡慕的性价比\n检测专业：公司团队拥有专业的基因测序和\n\t\t信息分析团队\n位点精确：检测位点拥有最为苛刻的挑选标\n\t\t准\n矫正系统：风险评估拥有自主研发的其他致\n\t\t病因素纠正系统\n社交属性：用户检测后拥有一套属于你的个\n\t\t性标签和基因关系";
//    chanPinTeSeJieShaoLabel.numberOfLines = 0;
//    chanPinTeSeJieShaoLabel.textColor = [UIColor blackColor];
//    chanPinTeSeJieShaoLabel.font = [UIFont systemFontOfSize:k16Big];
//    [chanPinTeSeJieShaoLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:chanPinTeSeJieShaoLabel.text lineHeight:8]];
//    [whiteBackGroundViewOnChanPinTese addSubview:chanPinTeSeJieShaoLabel];
//    
//    // 产品特色底部灰色条
//    UILabel *grayLineOnChanPinTeSeBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, whiteBackGroundViewOnChanPinTese.bottom + 47 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
//    grayLineOnChanPinTeSeBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
//    [self.backGroundScrollV addSubview:grayLineOnChanPinTeSeBottom];
//    
//    
//#warning 产品流程
//    
//    // 产品流程图标
//    UIImageView *chanPinLiuChengImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinTeSeBottom.bottom + 30 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
//    chanPinLiuChengImageV.image = [UIImage imageNamed:@"chanpinliucheng-chanpin"];
//    [self.backGroundScrollV addSubview:chanPinLiuChengImageV];
//    
//    UILabel *chanPinLiuChengTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinLiuChengImageV.right + 12 * kAdjustParamater, grayLineOnChanPinTeSeBottom.bottom + 30 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
//    chanPinLiuChengTitleLabel.text = @"产品流程";
//    chanPinLiuChengTitleLabel.textColor = kCyanColor;
//    chanPinLiuChengTitleLabel.textAlignment = NSTextAlignmentCenter;
//    chanPinLiuChengTitleLabel.font = [UIFont systemFontOfSize:k18Big];
//    chanPinLiuChengTitleLabel.layer.borderColor = [kCyanColor CGColor];
//    chanPinLiuChengTitleLabel.layer.borderWidth = 1 * kAdjustParamater;
//    chanPinLiuChengTitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
//    [self.backGroundScrollV addSubview:chanPinLiuChengTitleLabel];
// 
//    // 下订单购买图片
//    UIImageView *xiaDingDanGouMaiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(27 * kAdjustParamater, chanPinLiuChengTitleLabel.bottom  + 40 * kAdjustParamater, 48 * kAdjustParamater, 48 * kAdjustParamater)];
//  //  xiaDingDanGouMaiImageV.backgroundColor = [UIColor redColor];
//    xiaDingDanGouMaiImageV.image = [UIImage imageNamed:@"xiadingdan-chanpin"];
//    [self.backGroundScrollV addSubview:xiaDingDanGouMaiImageV];
//    
//    UILabel *xiaDingDanGouMaiLabel = [[UILabel alloc] initWithFrame:CGRectMake(xiaDingDanGouMaiImageV.left -5 * kAdjustParamater, xiaDingDanGouMaiImageV.bottom + 23 * kAdjustParamater, 58 * kAdjustParamater, 15 * kAdjustParamater)];
//  //  xiaDingDanGouMaiLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
//    xiaDingDanGouMaiLabel.text = @"下单购买";
//    xiaDingDanGouMaiLabel.textColor = kCyanColor;
//    xiaDingDanGouMaiLabel.textAlignment = NSTextAlignmentCenter;
//    xiaDingDanGouMaiLabel.font = [UIFont systemFontOfSize:k14Big];
//    [self.backGroundScrollV addSubview:xiaDingDanGouMaiLabel];
//    
//    // 下单购买右面的箭头
//    UIImageView *xiaDanGouMaiRightJianTou = [[UIImageView alloc] initWithFrame:CGRectMake(xiaDingDanGouMaiImageV.right + 15 * kAdjustParamater, xiaDingDanGouMaiImageV.top + 15 * kAdjustParamater, 25 * kAdjustParamater, 15 * kAdjustParamater)];
//    xiaDanGouMaiRightJianTou.image = [UIImage imageNamed:@"jiansejiantou-chanpin"];
// //   xiaDanGouMaiRightJianTou.backgroundColor = [UIColor redColor];
//    [self.backGroundScrollV addSubview:xiaDanGouMaiRightJianTou];
//    
//     // 样本采集
//    UIImageView *yangBenCaiJiImageV = [[UIImageView alloc] initWithFrame:CGRectMake(xiaDanGouMaiRightJianTou.right + 3 * kAdjustParamater, xiaDingDanGouMaiImageV.top, 48 * kAdjustParamater, 48 * kAdjustParamater)];
//    yangBenCaiJiImageV.image = [UIImage imageNamed:@"yangpincaiji-chanpin"];
//    [self.backGroundScrollV addSubview:yangBenCaiJiImageV];
//    
//    // 样本采集文本
//    UILabel *yangBenCaiJiLabel = [[UILabel alloc] initWithFrame:CGRectMake(yangBenCaiJiImageV.left - 5 * kAdjustParamater, xiaDingDanGouMaiLabel.top, 58 * kAdjustParamater, 15 * kAdjustParamater)];
//    yangBenCaiJiLabel.text = @"样本采集";
//    yangBenCaiJiLabel.font = [UIFont systemFontOfSize:k14Big];
//    yangBenCaiJiLabel.textColor = kCyanColor;
//    yangBenCaiJiLabel.textAlignment = NSTextAlignmentCenter;
//    [self.backGroundScrollV addSubview:yangBenCaiJiLabel];
//    
//    // 样本采集右边的箭头
//    
//    UIImageView *yangBenCaiJiRightJianTou = [[UIImageView alloc] initWithFrame:CGRectMake(yangBenCaiJiImageV.right + 3 * kAdjustParamater, xiaDanGouMaiRightJianTou.top, 25 * kAdjustParamater, 15 * kAdjustParamater)];
//    yangBenCaiJiRightJianTou.image = [UIImage imageNamed:@"jiansejiantou-chanpin"];
//    [self.backGroundScrollV addSubview:yangBenCaiJiRightJianTou];
//    
//    // 基因检测
//    UIImageView *jiYiJianCeImageV = [[UIImageView alloc] initWithFrame:CGRectMake(yangBenCaiJiRightJianTou.right + 15 * kAdjustParamater, xiaDingDanGouMaiImageV.top, 48 * kAdjustParamater, 48 * kAdjustParamater)];
//    jiYiJianCeImageV.image = [UIImage imageNamed:@"jiyinjiance-chanpin"];
//    [self.backGroundScrollV addSubview:jiYiJianCeImageV];
//    
//    // 基因检测文本
//    UILabel *jiYiJianCeLabel = [[UILabel alloc] initWithFrame:CGRectMake(jiYiJianCeImageV.left - 5 * kAdjustParamater, xiaDingDanGouMaiLabel.top, 58 * kAdjustParamater, 15 * kAdjustParamater)];
//    jiYiJianCeLabel.text = @"基因检测";
//    jiYiJianCeLabel.textColor = kCyanColor;
//    jiYiJianCeLabel.font = [UIFont systemFontOfSize:k14Big];
//    jiYiJianCeLabel.textAlignment = NSTextAlignmentCenter;
//    [self.backGroundScrollV addSubview:jiYiJianCeLabel];
//    
//    // 基因检测右边的箭头
//    UIImageView *jiYiJianCeRightJianTou = [[UIImageView alloc] initWithFrame:CGRectMake(jiYiJianCeImageV.right + 15 * kAdjustParamater, xiaDanGouMaiRightJianTou.top, 25 * kAdjustParamater, 15 * kAdjustParamater)];
//    jiYiJianCeRightJianTou.image = [UIImage imageNamed:@"jiansejiantou-chanpin"];
//    [self.backGroundScrollV addSubview:jiYiJianCeRightJianTou];
//    
//    // 查看报告
//    UIImageView *chaKanBaoGaoImageV = [[UIImageView alloc] initWithFrame:CGRectMake(jiYiJianCeRightJianTou.right + 7 * kAdjustParamater, xiaDingDanGouMaiImageV.top, 48 * kAdjustParamater, 48 * kAdjustParamater)];
//    chaKanBaoGaoImageV.image = [UIImage imageNamed:@"chakanbaogao"];
//    [self.backGroundScrollV addSubview:chaKanBaoGaoImageV];
//    
//    // 查看报告文本
//    UILabel *chaKanBaoGaoLabel = [[UILabel alloc] initWithFrame:CGRectMake(chaKanBaoGaoImageV.left - 5 * kAdjustParamater, xiaDingDanGouMaiLabel.top, 58 * kAdjustParamater, 15 * kAdjustParamater)];
//    chaKanBaoGaoLabel.text = @"查看报告";
//    chaKanBaoGaoLabel.textColor = kCyanColor;
//    chaKanBaoGaoLabel.font = [UIFont systemFontOfSize:k14Big];
//    chaKanBaoGaoLabel.textAlignment = NSTextAlignmentCenter;
//    [self.backGroundScrollV addSubview:chaKanBaoGaoLabel];
//    
//    
//    // 产品流程下方的灰色条
//    UILabel *grayLineOnChanPinLiuChengBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, xiaDingDanGouMaiLabel.bottom + 45 * kAdjustParamater, kScreenWidth, 10 * kAdjustParamater)];
//    grayLineOnChanPinLiuChengBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
//    [self.backGroundScrollV addSubview:grayLineOnChanPinLiuChengBottom];
//    
//
  
#warning 版本交错
#if 0
#warning 产品评价
    // 产品评价的图标
    UIImageView *chanPinPingJiaImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnChanPinLiuChengBottom.bottom + 30 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinPingJiaImageV.image = [UIImage imageNamed:@"chanpinpingjia-chanpin"];
    [self.backGroundScrollV addSubview:chanPinPingJiaImageV];
    
    // 产品评价
    UILabel *chanPinPingJiaLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinPingJiaImageV.right + 12 * kAdjustParamater, grayLineOnChanPinLiuChengBottom.bottom + 30 * kAdjustParamater, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    chanPinPingJiaLabel.text = @"产品评价";
    chanPinPingJiaLabel.textColor = kCyanColor;
    chanPinPingJiaLabel.font = [UIFont systemFontOfSize:k18Big];
    chanPinPingJiaLabel.textAlignment = NSTextAlignmentCenter;
    chanPinPingJiaLabel.layer.borderColor = [kCyanColor CGColor];
    chanPinPingJiaLabel.layer.borderWidth = 1 * kAdjustParamater;
    chanPinPingJiaLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:chanPinPingJiaLabel];
    
    // 浏览量
    UILabel *liuLanLiangLabel = [[UILabel alloc] initWithFrame:CGRectMake(chanPinPingJiaLabel.right + 45 * kAdjustParamater,grayLineOnChanPinLiuChengBottom.bottom + 32 * kAdjustParamater, 75 * kAdjustParamater, 21 * kAdjustParamater)];
    liuLanLiangLabel.text = @"浏览量1500";
    liuLanLiangLabel.textColor = kCyanColor;
    liuLanLiangLabel.font = [UIFont systemFontOfSize:k13Big];
    liuLanLiangLabel.textAlignment = NSTextAlignmentCenter;
    liuLanLiangLabel.layer.borderColor = [kCyanColor CGColor];
    liuLanLiangLabel.layer.borderWidth = 1 * kAdjustParamater;
    liuLanLiangLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:liuLanLiangLabel];
    
    // 评论数
    UILabel *pinglunLabel = [[UILabel alloc] initWithFrame:CGRectMake(liuLanLiangLabel.right + 15 * kAdjustParamater, liuLanLiangLabel.top, 62 * kAdjustParamater, 21 * kAdjustParamater)];
    pinglunLabel.text = @"评论数25";
    pinglunLabel.textColor = kCyanColor;
    pinglunLabel.font = [UIFont systemFontOfSize:k13Big];
    pinglunLabel.textAlignment = NSTextAlignmentCenter;
    pinglunLabel.layer.borderColor = [kCyanColor CGColor];
    pinglunLabel.layer.borderWidth = 1 * kAdjustParamater;
    pinglunLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:pinglunLabel];
    
    // 产品评价下方细的灰色条
    UILabel *smallGrayLineOnChanPinPingJiaBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, chanPinPingJiaLabel.bottom + 15 * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater)];
    smallGrayLineOnChanPinPingJiaBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.05];
    [self.backGroundScrollV addSubview:smallGrayLineOnChanPinPingJiaBottom];
    
    
    // 布局两条评价
    // 第一条评价的用户头像
    UIImageView *firstUserImageVOfPingJia = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, smallGrayLineOnChanPinPingJiaBottom.bottom + 20 * kAdjustParamater, 36 * kAdjustParamater, 36 * kAdjustParamater)];
    firstUserImageVOfPingJia.image = [UIImage imageNamed:@""];
    firstUserImageVOfPingJia.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundScrollV addSubview:firstUserImageVOfPingJia];
    
    // 第一条评价的用户名字
    UILabel *firstUserNameOfPingJiaLabel = [[UILabel alloc] initWithFrame:CGRectMake(firstUserImageVOfPingJia.right + 8 * kAdjustParamater, firstUserImageVOfPingJia.top, 200 * kAdjustParamater, 13 * kAdjustParamater)];
    firstUserNameOfPingJiaLabel.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    firstUserNameOfPingJiaLabel.text = @"张国文";
    firstUserNameOfPingJiaLabel.textAlignment = NSTextAlignmentLeft;
    firstUserNameOfPingJiaLabel.textColor = [UIColor blackColor];
    firstUserNameOfPingJiaLabel.font = [UIFont systemFontOfSize:k15Big];
    [self.backGroundScrollV addSubview:firstUserNameOfPingJiaLabel];
    
    
    
#else
    
#warning 相关链接
    
    // 相关链接图标
    UIImageView *xiangGuanLianJieImageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 * kAdjustParamater, grayLineOnShiYongRenQunLabel.bottom + 20 * kAdjustParamater, 25 * kAdjustParamater, 25 * kAdjustParamater)];
    xiangGuanLianJieImageV.image = [UIImage imageNamed:@"xiangguanlianjie"];
    [self.backGroundScrollV addSubview:xiangGuanLianJieImageV];
    
    // 相关链接标题
    UILabel *xiangGuanLianJieTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(xiangGuanLianJieImageV.right + 12 * kAdjustParamater, xiangGuanLianJieImageV.top, 100 * kAdjustParamater, 25 * kAdjustParamater)];
    xiangGuanLianJieTitleLabel.text = @"相关链接";
    xiangGuanLianJieTitleLabel.textColor = kCyanColor;
    xiangGuanLianJieTitleLabel.font = [UIFont systemFontOfSize:k18Big];
    xiangGuanLianJieTitleLabel.textAlignment = NSTextAlignmentCenter;
    xiangGuanLianJieTitleLabel.layer.borderColor = [kCyanColor CGColor];
    xiangGuanLianJieTitleLabel.layer.borderWidth = 1 * kAdjustParamater;
    xiangGuanLianJieTitleLabel.layer.cornerRadius = 4 * kAdjustParamater;
    [self.backGroundScrollV addSubview:xiangGuanLianJieTitleLabel];
    
    // 相关链接图标下方的灰色条
    UILabel *grayLineOnXiangGuanLianJieTuBiaoBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, xiangGuanLianJieImageV.bottom + 20 * kAdjustParamater, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnXiangGuanLianJieTuBiaoBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundScrollV addSubview:grayLineOnXiangGuanLianJieTuBiaoBottom];
    
    
    
    // 相关链接咨询
    UIButton *xiangGuanZiXunButton = [UIButton buttonWithType:UIButtonTypeSystem];
    xiangGuanZiXunButton.frame = CGRectMake(0, grayLineOnXiangGuanLianJieTuBiaoBottom.bottom, kScreenWidth / 2, 47 * kAdjustParamater);
    xiangGuanZiXunButton.backgroundColor = [UIColor whiteColor];
    [xiangGuanZiXunButton setTitle:@"#相关咨询#" forState:UIControlStateNormal];
    [xiangGuanZiXunButton setTitleColor:[[UIColor blackColor]colorWithAlphaComponent:0.5] forState:UIControlStateNormal];
     xiangGuanZiXunButton.titleLabel.font = [UIFont systemFontOfSize:k20Big];
    [xiangGuanZiXunButton addTarget:self action:@selector(xiangGuanZiXun:) forControlEvents:UIControlEventTouchUpInside];
    [self.backGroundScrollV addSubview:xiangGuanZiXunButton];
    
    // 相关帖子
    UIButton *xiangGuanTieZiButton = [UIButton buttonWithType:UIButtonTypeSystem];
    xiangGuanTieZiButton.frame = CGRectMake(xiangGuanZiXunButton.right + 1 * kAdjustParamater, xiangGuanZiXunButton.top, kScreenWidth / 2, 47 * kAdjustParamater);
    xiangGuanTieZiButton.backgroundColor = [UIColor whiteColor];
    [xiangGuanTieZiButton setTitle:@"#相关帖子#" forState:UIControlStateNormal];
    [xiangGuanTieZiButton setTitleColor:[[UIColor blackColor]colorWithAlphaComponent:0.5] forState:UIControlStateNormal];
    xiangGuanTieZiButton.titleLabel.font = [UIFont systemFontOfSize:k20Big];
    [xiangGuanTieZiButton addTarget:self action:@selector(xiangGuanTieZi:) forControlEvents:UIControlEventTouchUpInside];
    [self.backGroundScrollV addSubview:xiangGuanTieZiButton];
    
    // 竖着的灰色条
    UILabel *shuZheGrayLine = [[UILabel alloc] initWithFrame:CGRectMake(165 * kAdjustParamater , grayLineOnXiangGuanLianJieTuBiaoBottom.bottom + 23 * kAdjustParamater, 47 * kAdjustParamater, 1 * kAdjustParamater)];
    shuZheGrayLine.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    shuZheGrayLine.transform = CGAffineTransformMakeRotation(M_PI / 2);
    [self.backGroundScrollV addSubview:shuZheGrayLine];
    
    // 相关资讯下方的灰色条
    UILabel *grayLineOnXiangGuanZiXunBottom = [[UILabel alloc] initWithFrame:CGRectMake(0, xiangGuanZiXunButton.bottom, kScreenWidth, 1 * kAdjustParamater)];
    grayLineOnXiangGuanZiXunBottom.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.1];
    [self.backGroundScrollV addSubview:grayLineOnXiangGuanZiXunBottom];
#endif
    
    // 进行背景scrollView的frame的重新定义
    self.backGroundScrollV.contentSize = CGSizeMake(kScreenWidth, xiangGuanZiXunButton.bottom + 150 * kAdjustParamater);
    
    
    
    
    
    
    
    
    
    
    
    
}

#pragma mark - 产品简介详情
- (void)canPinDetalGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"产品简介详情");
    LeiContentDetailIntroduceViewController *leiContentDetailIntroduceVC = [[LeiContentDetailIntroduceViewController alloc] init];
    leiContentDetailIntroduceVC.leiName = self.productTitle;
    leiContentDetailIntroduceVC.qianJieGeZiDaXie = self.leiDetailIntroduceQianJiGeDaXie;
    leiContentDetailIntroduceVC.detailString = self.productDetailIntroduce;
    leiContentDetailIntroduceVC.gengDuoXinXinUrl = self.gengDuoXinXiTuPian;
    [self.navigationController pushViewController:leiContentDetailIntroduceVC animated:YES];
}

- (void)canPinDetailLabelGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"产品简介详情");
    LeiContentDetailIntroduceViewController *leiContentDetailIntroduceVC = [[LeiContentDetailIntroduceViewController alloc] init];
    leiContentDetailIntroduceVC.leiName = self.productTitle;
    leiContentDetailIntroduceVC.qianJieGeZiDaXie = self.leiDetailIntroduceQianJiGeDaXie;
    leiContentDetailIntroduceVC.detailString = self.productDetailIntroduce;
    leiContentDetailIntroduceVC.gengDuoXinXinUrl = self.gengDuoXinXiTuPian;
    [self.navigationController pushViewController:leiContentDetailIntroduceVC animated:YES];
}

#pragma mark - 产品检测详情
- (void)canPinJianCeDetalGes:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"产品检测详情");
    DiseaseArrayViewController *diseaseArrayVC = [[DiseaseArrayViewController alloc] init];
    diseaseArrayVC.productTitle = self.productTitle;
    diseaseArrayVC.diseaseArray = self.diseaseDanXiangArray;
    [self.navigationController pushViewController:diseaseArrayVC animated:YES];
}

- (void)canPinJianCeDetailImageTap:(UITapGestureRecognizer *)tapGes
{
    NSLog(@"产品检测详情");
    DiseaseArrayViewController *diseaseArrayVC = [[DiseaseArrayViewController alloc] init];
    diseaseArrayVC.productTitle = self.productTitle;
    diseaseArrayVC.diseaseArray = self.diseaseDanXiangArray;
    [self.navigationController pushViewController:diseaseArrayVC animated:YES];
}

//#pragma mark - 检测意义详情
//- (void)jianCeYiYiDetalLabelGes:(UITapGestureRecognizer *)tapGes
//{
//    NSLog(@"检测意义详情");
//    // 创建动画
//    [self createJianCeDetailAnimationJianCeNeiRongBottom:self.jianCeNeiRongBottom shouldHeight:self.dongHuaHeight];
//}
//
//- (void)jianCeYiYiDetailImageVGes:(UITapGestureRecognizer *)tapGes
//{
//    NSLog(@"检测意义详情");
//}

#pragma mark - 相关资讯
- (void)xiangGuanZiXun:(UIButton *)button
{
    NSLog(@"相关资讯");
    MoreZiXunViewController *moreZiXunVC = [[MoreZiXunViewController alloc] init];
    [self.navigationController pushViewController:moreZiXunVC animated:YES];
}

#pragma mark - 相关帖子
- (void)xiangGuanTieZi:(UIButton *)button
{
    NSLog(@"相关帖子");
}

#pragma mark - 动画取消
- (void)dismissGrayViewGes:(UITapGestureRecognizer *)tapGes
{
    [tapGes.view removeFromSuperview];
}


#pragma mark - 创建检测详情动画
- (void)createJianCeDetailAnimationJianCeNeiRongBottom:(CGFloat)bottomOne  shouldHeight:(CGFloat)height
{
    // 添加灰色背景
    UIView *grayBackGroundOnJianCeYiYi = [[UIView alloc] initWithFrame:CGRectMake(0, bottomOne, kScreenWidth, height)];
    grayBackGroundOnJianCeYiYi.userInteractionEnabled = YES;
    grayBackGroundOnJianCeYiYi.backgroundColor = [UIColor clearColor];
    [self.backGroundScrollV addSubview:grayBackGroundOnJianCeYiYi];
    // 添加手势
    UITapGestureRecognizer *grayBackGroundTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissGrayViewGes:)];
    [grayBackGroundOnJianCeYiYi addGestureRecognizer:grayBackGroundTapGes];
    
    
    // 详情
    UILabel *xiangQingLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 70 * kAdjustParamater, 35 * kAdjustParamater, 35 * kAdjustParamater, 15 * kAdjustParamater)];
    xiangQingLabel.text = @"详情";
    xiangQingLabel.textColor = [UIColor clearColor];
    xiangQingLabel.textAlignment = NSTextAlignmentCenter;
    xiangQingLabel.font = [UIFont systemFontOfSize:k17Big];
    [grayBackGroundOnJianCeYiYi addSubview:xiangQingLabel];
    
    // 白色框
    UIImageView *whiteKuangImageV = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 205 * kAdjustParamater, xiangQingLabel.bottom + 3 * kAdjustParamater, 195 * kAdjustParamater, 0)];
    whiteKuangImageV.image =[UIImage imageNamed:@"chanpinkuang-chanpin"];
    [grayBackGroundOnJianCeYiYi addSubview:whiteKuangImageV];
    
    // 添加文本
    UILabel *JianCeYiYiContentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20 * kAdjustParamater, 30 * kAdjustParamater, whiteKuangImageV.width - 30  * kAdjustParamater, 0 * kAdjustParamater)];
   //  JianCeYiYiContentLabel.backgroundColor = [UIColor redColor];
     JianCeYiYiContentLabel.text = @"1、及时准确的了解自己\n\t遗传背景信息\n2、尽早预测自身心脑血\n\t管疾病的发生风险\n3、有针对性的定制相同\n\t的健康管理意识较\n\t强的中老年人";
    JianCeYiYiContentLabel.textColor = [UIColor whiteColor];
    JianCeYiYiContentLabel.numberOfLines = 0;
    JianCeYiYiContentLabel.font = [UIFont systemFontOfSize:k15Big];
    // 进行行间距的调整
    [JianCeYiYiContentLabel setAttributedText:[[NetStatusHandle shareHandle] setHangJianJvOfLabel:JianCeYiYiContentLabel.text lineHeight:8]];
    
    
    [whiteKuangImageV addSubview:JianCeYiYiContentLabel];
    
    // 动画
    [UIView animateWithDuration:0.5 animations:^{
        grayBackGroundOnJianCeYiYi.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
        xiangQingLabel.textColor = [UIColor whiteColor];
        whiteKuangImageV.frame = CGRectMake(whiteKuangImageV.frame.origin.x, whiteKuangImageV.frame.origin.y, 195 * kAdjustParamater, 230 * kAdjustParamater);
        [JianCeYiYiContentLabel sizeToFit];
       // JianCeYiYiContentLabel.frame = CGRectMake(JianCeYiYiContentLabel.frame.origin.x, JianCeYiYiContentLabel.frame.origin.y, JianCeYiYiContentLabel.frame.size.width, JianCeYiYiContentLabel.frame.size.height);
    } completion:^(BOOL finished) {
        
    }];
    
    
}


#warning 表格的代理
- (NSInteger)numberOfRowsInFormView:(KWFormView *)formView
{
   // NSLog(@"几行:%ld", self.jiBingNameArray.count / 3);
    if (self.jiBingNameArray.count % 3 > 0) {
        return self.jiBingNameArray.count / 3 + 1;
    }
    return self.jiBingNameArray.count / 3;
}

- (NSInteger)formViewColumnsInRow:(KWFormView *)formView
{
    return 3;
}

- (CGFloat)formView:(KWFormView *)formView widthForColumn:(NSInteger)column
{
    return 112 * kAdjustParamater;
}

- (CGFloat)formView:(KWFormView *)formView heightForRow:(NSInteger)row
{
    return 30 * kAdjustParamater;
}

- (NSString *)formView:(KWFormView *)formView textForColumn:(NSInteger)column inRow:(NSInteger)row
{
  //  NSLog(@"%ld%ld", row, column);
 
    if ((row * 3 + column) >= self.jiBingNameArray.count) {
      return nil;
    }
    return self.jiBingNameArray[row * 3 + column];
}

- (UIColor *)formView:(KWFormView *)formView colorOfColumn:(NSInteger)column inRow:(NSInteger)row
{
    return [UIColor whiteColor];
}

- (UIColor *)formView:(KWFormView *)formView contentColorOfColumn:(NSInteger)column inRow:(NSInteger)row
{
    return [UIColor blackColor];
}

- (UIColor *)formViewBorderColor:(KWFormView *)formView
{
    return kCyanColor;
}

- (UIFont *)formViewFontOfContent:(KWFormView *)formView
{
    return [UIFont systemFontOfSize:k14Big];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
